[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
S2I(SEXP,IEXP) (INTEGER)
Function
Convert a string in a specified number base to an integer.
Syntax
S2I(str,base)
str = Any string expression to convert to integer format.
base = An integer expression with the number base (2 through 36) to
convert from.
Return Type & Value
INTEGER
Returns str converted from the specified number base to an integer.
Remarks
People work with decimal (base 10) numbers, whereas computers work with
binary (base 2) numbers. It is often more convienient to store or input
numbers in a format other than decimal for clarity, compactness, or
other reasons. This function will convert a string in any number base
from 2 to 36 to a number. So, S2I("1010",2) would return a 10; S2I("Z",36)
would return 35. For more information on number bases, consult .
Examples
INTEGER i
STRING s
INPUTTEXT "Enter a string (any base)",s,@X0E,40
FOR i = 2 TO 36
PRINTLN s," = ",S2I(s,i)," base ",i
NEXT
See Also:
I2S()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson